package com.gupao.edu.study.singleton;
/*
* @Author: guqy
* @Description: 双重检测+指令重拍（无法验证，很难）
* @Date 11:58 2018/3/8
* @param null
* @return
*/
public class LazyDoubleCheck {

    //实例对象
//    private static LazyDoubleCheck instance;
    private volatile static  LazyDoubleCheck instance;
    //私有构造
    private LazyDoubleCheck() {
    }
    //get实例静态方法
    public static LazyDoubleCheck getInstance(){

        if(instance == null){
            synchronized (LazyDoubleCheck.class){
                if(instance ==null){
                    instance = new LazyDoubleCheck();
                }
            }
        }
        return instance;
    }
}
